//
//  XSDschema.h
//  xsd2cocoa
//
//  Created by Stefan Winter on 5/22/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "XSType.h"

@class MGTemplateEngine;
@class XSDcomplexType;

@interface XSDschema : NSObject {
    
    
@private
    NSString* _targetNamespace;
    NSString* _classPrefix;
    NSDictionary* nsDeclDict;
    NSMutableDictionary* simpleTypeDict;
    NSArray* complexTypes;
    NSString *classTemplateString;
    NSString *headerTemplateString;
    NSString *readComplexTypeElementTemplate;
    MGTemplateEngine *engine;
}

@property (nonatomic, retain) NSString* targetNamespace;
@property (nonatomic, retain) NSString* classPrefix;
@property (nonatomic, retain) NSString* classTemplateString;
@property (nonatomic, retain) NSString* headerTemplateString;
@property (nonatomic, retain) NSString* readComplexTypeElementTemplate;
@property (nonatomic, retain) NSArray* complexTypes;

+ (id) newWithUrl: (NSURL*) schemaUrl prefix: (NSString*) prefix error: (NSError**) error;

- (void) loadTemplate: (NSURL*) templateUrl error: (NSError**) error;

- (void) generateInto: (NSURL*) destinationFolder
                error: (NSError**) error;

- (id<XSType>) typeForName: (NSString*) qname;

- (void) addComplexType: (XSDcomplexType*) cType;

@end
